package cn.tutu.blockchain.base;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 对外接口基本对象 1.实现序列化 2.封装ToString()方法
 */
public class BaseObject implements Serializable {

	private static final long serialVersionUID = 1078264472974293547L;

	private String id; // 主键ID

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createDatetime;// 创建时间
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date lastUpdateDatetime;// 最后更新时间

	// 查询条件字段
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date starDateTime; // 开始时间
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endDateTime; // 结束时间

	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);

	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getCreateDatetime() {
		return createDatetime;
	}

	public void setCreateDatetime(Date createDatetime) {
		this.createDatetime = createDatetime;
	}

	public Date getLastUpdateDatetime() {
		return lastUpdateDatetime;
	}

	public void setLastUpdateDatetime(Date lastUpdateDatetime) {
		this.lastUpdateDatetime = lastUpdateDatetime;
	}

	public Date getStarDateTime() {
		return starDateTime;
	}

	public void setStarDateTime(Date starDateTime) {
		this.starDateTime = starDateTime;
	}

	public Date getEndDateTime() {
		return endDateTime;
	}

	public void setEndDateTime(Date endDateTime) {
		this.endDateTime = endDateTime;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
